import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/home_visitor_record_entity.dart';

HomeVisitorRecordEntity $HomeVisitorRecordEntityFromJson(Map<String, dynamic> json) {
	final HomeVisitorRecordEntity homeVisitorRecordEntity = HomeVisitorRecordEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		homeVisitorRecordEntity.code = code;
	}
	final HomeVisitorRecordObj? obj = jsonConvert.convert<HomeVisitorRecordObj>(json['obj']);
	if (obj != null) {
		homeVisitorRecordEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		homeVisitorRecordEntity.msg = msg;
	}
	return homeVisitorRecordEntity;
}

Map<String, dynamic> $HomeVisitorRecordEntityToJson(HomeVisitorRecordEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] = entity.obj.toJson();
	data['msg'] = entity.msg;
	return data;
}

HomeVisitorRecordObj $HomeVisitorRecordObjFromJson(Map<String, dynamic> json) {
	final HomeVisitorRecordObj homeVisitorRecordObj = HomeVisitorRecordObj();
	final List<HomeVisitorRecordObjList>? list = jsonConvert.convertListNotNull<HomeVisitorRecordObjList>(json['list']);
	if (list != null) {
		homeVisitorRecordObj.list = list;
	}
	return homeVisitorRecordObj;
}

Map<String, dynamic> $HomeVisitorRecordObjToJson(HomeVisitorRecordObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['list'] =  entity.list.map((v) => v.toJson()).toList();
	return data;
}

HomeVisitorRecordObjList $HomeVisitorRecordObjListFromJson(Map<String, dynamic> json) {
	final HomeVisitorRecordObjList homeVisitorRecordObjList = HomeVisitorRecordObjList();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		homeVisitorRecordObjList.id = id;
	}
	final String? room = jsonConvert.convert<String>(json['room']);
	if (room != null) {
		homeVisitorRecordObjList.room = room;
	}
	final String? owner = jsonConvert.convert<String>(json['owner']);
	if (owner != null) {
		homeVisitorRecordObjList.owner = owner;
	}
	final String? visitor = jsonConvert.convert<String>(json['visitor']);
	if (visitor != null) {
		homeVisitorRecordObjList.visitor = visitor;
	}
	final String? phoneNumber = jsonConvert.convert<String>(json['phoneNumber']);
	if (phoneNumber != null) {
		homeVisitorRecordObjList.phoneNumber = phoneNumber;
	}
	final int? visitorNum = jsonConvert.convert<int>(json['visitorNum']);
	if (visitorNum != null) {
		homeVisitorRecordObjList.visitorNum = visitorNum;
	}
	final String? visitStartTime = jsonConvert.convert<String>(json['visitStartTime']);
	if (visitStartTime != null) {
		homeVisitorRecordObjList.visitStartTime = visitStartTime;
	}
	final String? visitEndTime = jsonConvert.convert<String>(json['visitEndTime']);
	if (visitEndTime != null) {
		homeVisitorRecordObjList.visitEndTime = visitEndTime;
	}
	final String? licensePlate = jsonConvert.convert<String>(json['licensePlate']);
	if (licensePlate != null) {
		homeVisitorRecordObjList.licensePlate = licensePlate;
	}
	final String? visitReason = jsonConvert.convert<String>(json['visitReason']);
	if (visitReason != null) {
		homeVisitorRecordObjList.visitReason = visitReason;
	}
	final String? qrCodeUrl = jsonConvert.convert<String>(json['qrCodeUrl']);
	if (qrCodeUrl != null) {
		homeVisitorRecordObjList.qrCodeUrl = qrCodeUrl;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		homeVisitorRecordObjList.createTime = createTime;
	}
	return homeVisitorRecordObjList;
}

Map<String, dynamic> $HomeVisitorRecordObjListToJson(HomeVisitorRecordObjList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['room'] = entity.room;
	data['owner'] = entity.owner;
	data['visitor'] = entity.visitor;
	data['phoneNumber'] = entity.phoneNumber;
	data['visitorNum'] = entity.visitorNum;
	data['visitStartTime'] = entity.visitStartTime;
	data['visitEndTime'] = entity.visitEndTime;
	data['licensePlate'] = entity.licensePlate;
	data['visitReason'] = entity.visitReason;
	data['qrCodeUrl'] = entity.qrCodeUrl;
	data['createTime'] = entity.createTime;
	return data;
}